home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / BESSY0.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-29  |  879b  |  23 lines

  1. FUNCTION bessy0(x: real): real;
  2. VAR
  3.    xx,z: real;  y,ans,ans1,ans2: double;
  4. BEGIN
  5.    IF (x < 8.0) THEN BEGIN
  6.       y := sqr(x);
  7.       ans1 := -2957821389.0+y*(7062834065.0+y*(-512359803.6
  8.          +y*(10879881.29+y*(-86327.92757+y*228.4622733))));
  9.       ans2 := 40076544269.0+y*(745249964.8+y*(7189466.438
  10.          +y*(47447.26470+y*(226.1030244+y*1.0))));
  11.       ans := (ans1/ans2)+0.636619772*bessj0(x)*ln(x);
  12.       bessy0 := sngl(ans)  END
  13.    ELSE BEGIN
  14.       z := 8.0/x; y := sqr(z); xx := x-0.785398164;
  15.       ans1 := 1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4
  16.          +y*(-0.2073370639e-5+y*0.2093887211e-6)));
  17.       ans2 := -0.1562499995e-1+y*(0.1430488765e-3
  18.          +y*(-0.6911147651e-5+y*(0.7621095161e-6+y*(-0.934945152e-7))));
  19.       ans := sin(xx)*ans1+z*cos(xx)*ans2;
  20.       ans := sqrt(0.636619772/x)*ans;
  21.       bessy0 := sngl(ans)  END
  22. END;
  23.